const ENV = process.env.NODE_ENV
const SERVER_DOMAIN = ENV === 'production' ? window.location.host + '/app' : 'qsngxm.hztangong.com/app'

// 正式
// const SERVER_DOMAIN = ENV === 'production' ? 'qqc.hztangong.com/a' : '114.55.103.65:8089/a
// const SERVER_DOMAIN = ENV === 'production' ? window.location.host : '114.55.103.65:8087/app'
// const SERVER_DOMAIN = ENV === 'production' ? window.location.host : '192.168.0.118:8080/qsng_wx/app'
const SERVER_HOST = 'http://' + SERVER_DOMAIN + '/'
const API = {
  // 注册
  REGIST: 'student/regist',
  // 退出登录
  LOGOUT: 'student/logout',
// 登录 POST
  LOGIN: 'student/login',
  // 培训
  // 课程列表 POST
  CLASSLISTDO: 'front/clazzList',
  // 全国区域列表 POST
  ZONELIST: 'common/zoneList',
  // 机构区域
  AREALIST: 'common/areaList',
  // 单位学期 POST
  TERMLIST: 'common/termList',
  // 专业分类 POST
  SPECIALTYLIST: 'common/specialtyList',
  // 时间段 POST
  WEEKLIST: 'common/weekList',
  // 课程详情 POST
  CLAZZVIEW: 'common/clazzView',
  // 班级报名 POST
  CLASSAPPLY: 'front/clazzApply',
  // 通知
  // 我的通知 POST
  NOTICELIST: 'student/noticeList',
  // 通知详情 GET
  NOTICEVIEW: 'student/noticeView',

  // 我的
  // 账户信息 POST
  STUDENTVIEW: 'student/studentView',
  // 机构配置 获取身份证是否必填 GET
  SETTING: 'common/setting',
  // 年级段 GET
  GRADELIST: 'common/gradeList',
  // 我的点到 今日点到 GET
  STUDENTSIGNTODAY: 'student/signToday',
  // 我的点到 点到统计 GET
  SIGNTERM: 'student/signTerm',
  // 点到详情 GET
  SIGNLIST: 'student/signList',
  // 我的班级 GET
  CLASSLIST: 'student/clazzList',
  // 修改个人信息 POST
  EDITPROFILE: 'student/editprofile',
  //根据预约号查询我的报名班级详情
  QUERYBYRESERVENO: 'front/searchApply',
  NOTIFYAPI: 'api/notify',
  GETAPPKEY: 'getAppKey',
  STUDENTSCHEDULE: 'student/schedule'
}

const output = {}
for (let key in API) {
  output[key] = SERVER_HOST + API[key]
}
output['SERVER_DOMAIN'] = SERVER_DOMAIN
output['SERVER_HOST'] = SERVER_HOST
output['ENV'] = ENV
output['PAYMENT_API'] = 'http://qsngxm.hztangong.com'

module.exports = output
